package com.collaboration.electron.services;

import com.collaboration.electron.dao.UserRepository;
import com.collaboration.electron.entities.U;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lydia
 * @param
 * @return 无
 */

@Service
public class UserService {

    @Autowired
    UserRepository userRepository;

    public List<U> getAll(){

        return userRepository.findAll();
    }

    public U save(U u){
        return userRepository.save(u);
    }

    public U findByUserName(String name){
        return userRepository.findByUserName(name);
    }
}
